package exam.demo20;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long h = in.nextLong();
        long b = in.nextLong();
        long k = in.nextLong();
        long red = 0;
        while(h > 0 || k > 0) {
            if(k <= 0) {
                red += a * 10;
                break;
            }
            if(h <= 0) {
                red += b * 10;
                break;
            }

            red += b;
            red += a;

            k -= a;
            h -= b;
        }
        System.out.println(red);
    }
}
